package cn.krui.project;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 上传目录查看
 */
@Configuration
public class DownloadConfig implements WebMvcConfigurer {
    @Value("${com.kr.web.common.staticaccesspath}")
    private String staticAccessPath;
    @Value("${com.kr.web.common.filePath}")
    private String uploadFolder;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(staticAccessPath).addResourceLocations("file:" + uploadFolder);
    }
}